package com.android.logcat;

/**
 * 日志打印工具类
 */
public final class LogUtil {
  
  private static ILogger log = LoggerConfig.getInstance().getLogger();
  
  private LogUtil() {
  }
  
  //I
  public static void i(Object msg) {
   i(null,msg,null);
  }
  
  public static void i(String tag, Object msg) {
    i(tag,msg,null);
  }
  
  public static void i(String tag, Object msg, Throwable e) {
    if (LoggerConfig.getInstance().enableDebug()) {
      log.i(tag, msg, e);
    }
  }
  
  //D
  public static void d(Object msg) {
    d(null,msg,null);
  }
  
  public static void d(String tag, Object msg) {
    d(tag,msg,null);
  }
  
  public static void d(String tag, Object msg, Throwable e) {
    if (LoggerConfig.getInstance().enableDebug()) {
      log.d(tag, msg, e);
    }
  }
  
  //E
  public static void e(Object msg) {
    e(null,msg,null);
  }
  
  public static void e(String tag, Object msg) {
    e(tag,msg,null);
  }
  
  public static void e(String tag, Object s, Throwable throwable) {
    if (LoggerConfig.getInstance().enableDebug()) {
      log.e(tag, s, throwable);
    }
  }
  
  //V
  public static void v(Object msg) {
    v(null,msg,null);
  }
  
  public static void v(String tag, Object msg) {
    v(tag,msg,null);
  }
  
  public static void v(String tag, Object msg, Throwable e) {
    if (LoggerConfig.getInstance().enableDebug()) {
      log.v(tag, msg, e);
    }
  }
  
  //W
  public static void w(Object s) {
    w(null,s,null);
  }
  
  public static void w(String tag, Object s) {
    w(tag,s,null);
  }
  
  public static void w(String tag, Object msg, Throwable e) {
    if (LoggerConfig.getInstance().enableDebug()) {
      log.w(tag, msg, e);
    }
  }
  
  //WTF
  public static void wtf(Object msg) {
    wtf(null,msg,null);
  }
  
  public static void wtf(String tag, Object msg) {
    wtf(tag,msg,null);
  }
  
  public static void wtf(String tag, Object msg, Throwable e) {
    if (LoggerConfig.getInstance().enableDebug()) {
      log.wtf(tag, msg, e);
    }
  }
  
  // System.out.println
  public static void println(Object msg) {
    if (LoggerConfig.getInstance().enableDebug()) {
      log.println(msg);
    }
  }
  
}
